﻿using Echars.Common;
using Echars.Common.BLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Echars.Web.Ashx
{
    /// <summary>
    /// AjaxGetBuildingName 的摘要说明
    /// </summary>
    public class AjaxGetBuildingName : IHttpHandler
    {
        public void ProcessRequest(HttpContext context)
        {
            var id = context.Request["zid"];
            var buildingName = EcharsBLL.Instance.GetBuildingName(id);
            var floorNo = EcharsBLL.Instance.GetFloorNo(id);
            var jsonObj = new { buildingName = buildingName, floorNo = floorNo };
            var json = jsonObj.T2Json();
            context.Response.ContentType = "text/plain";
            context.Response.Write(json);
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}